<?php

class CCouponCodeUse extends Zend_Db_Table
{
	protected $_name;
	protected $_primary;

	public function __construct()
	{
		$this->_name = R_PRE."couponcode_use";
		$this->_primary = "id";
		parent::__construct();
	}
	
	public function isexist($code, $uid='')
	{
		$db=$this->getAdapter();
		$where = $db->quoteInto('coupon = ?', $code);
		
		return $this->fetchRow($where);
	}
	
	public function add($data)
	{
		return $this->insert($data);
	}
}